<?php

/**
 * Vote filter form base class.
 *
 * @package    iEasy
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseVoteFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'celebrity_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'add_empty' => true)),
      'count_i'       => new sfWidgetFormFilterInput(),
      'status_i'      => new sfWidgetFormFilterInput(),
      'order_i'       => new sfWidgetFormFilterInput(),
      'daily_count'   => new sfWidgetFormFilterInput(),
      'weekly_count'  => new sfWidgetFormFilterInput(),
      'monthly_count' => new sfWidgetFormFilterInput(),
      'name'          => new sfWidgetFormFilterInput(),
      'txt'           => new sfWidgetFormFilterInput(),
      'renqi_vote_id' => new sfWidgetFormFilterInput(),
      'count_mask_i'  => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'celebrity_id'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Celebrity'), 'column' => 'celebrity_id')),
      'count_i'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'status_i'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'order_i'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'daily_count'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'weekly_count'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'monthly_count' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'name'          => new sfValidatorPass(array('required' => false)),
      'txt'           => new sfValidatorPass(array('required' => false)),
      'renqi_vote_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'count_mask_i'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('vote_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Vote';
  }

  public function getFields()
  {
    return array(
      'vote_id'       => 'Number',
      'celebrity_id'  => 'ForeignKey',
      'count_i'       => 'Number',
      'status_i'      => 'Number',
      'order_i'       => 'Number',
      'daily_count'   => 'Number',
      'weekly_count'  => 'Number',
      'monthly_count' => 'Number',
      'name'          => 'Text',
      'txt'           => 'Text',
      'renqi_vote_id' => 'Number',
      'count_mask_i'  => 'Number',
    );
  }
}
